import axios from '@/utils/request'
import { baseUrlConfig } from '@/config/config'

const baseProcessPath = baseUrlConfig.processBaseUrl
const baseGeneralPath = baseUrlConfig.businessBaseUrl



interface repairmanagement {
    condition: {
        columns?: string | null,
        createEndTime?: string | null,
        createStartTime?: string | null,
        createUserId?: string | null,
        createUserOrgId?: string | null,
        eqptFloor?: string | null,
        eqptTypeId?: number | null,
        eqptTypeOtr?: string | null,
        id?: number | null,
        nodeState?: string | null,
        organId?: number | null,
        problemId?: number | null,
        repAcceptState?: string | null,
        repApplyState?: string | null,
        repId?: number | null
        repName?: string | null,
        terminal?: string | null,
        urgency?: string | null,
        repCode?: string | null,
    },
    pageNum: number,
    pageSize: number
}
// 列表
export const repairList = (data: repairmanagement) => axios({
    url: baseProcessPath + '/rep/apply/find/page',
    method: 'post',
    data
})
// 新增
export const addrepair = (data: any) => axios({
    url: baseProcessPath + '/rep/apply/append',
    method: 'post',
    data
})
//导出
export const Exportapi = (data: any) => axios({
    url: baseProcessPath + "/rep/apply/exportXls",
    responseType: 'blob',
    // headers: {
    //     'Content-Type': 'application/json'
    //   },
    method: "post",
    data
})

//修改
export const editrepair = (data: any) => axios({
    url: baseProcessPath + '/rep/apply/update',
    method: 'post',
    data
})
// 查询问题类型
export const getPrograms = (data: any) => {
    return axios({
        url: baseGeneralPath + '/rep/problem/find',
        method: 'post',
        data
    })
}
// 查询设备类型
export const getEqptTypes = (data: any) => {
    return axios({
        url: baseGeneralPath + '/eqpt/type/find',
        method: 'post',
        data
    })
}

//问题上报
export const getProblem = (typeId: string) => axios({
    url: baseGeneralPath + '/rep/problem/find',
    method: 'post',
    data: {
        typeId,
    }
})
//设备类型
export const getdevive = (typeId: string) => axios({
    url: baseGeneralPath + "/eqpt/devive/find",
    method: 'post',
    data: {
        typeId,
    }
})
//上报至
export const getcompanys = (data = {}) => axios({
    url: baseProcessPath + '/rep/company/find',
    method: 'post',
    data
})
//驳回
export const repairReject = (data: any) => axios({
    url: baseProcessPath + "/rep/node/find",
    method: "post",
    data,
})